
const fs = require('fs')
const path = require('path')

module.exports = function(dist){
    if(!fs.existsSync(dist))return;
    fs.readdirSync(dist).forEach(item =>{
        if(fs.statSync(path.join(dist,item)).isFile()){
            fs.unlinkSync(path.join(dist,item))
        }else{
            fs.rmdirSync(path.join(dist,item))
        }
    })
    fs.rmdirSync(dist)
}